package com.hup.utils.io.socket.udp;

import java.io.Closeable;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author hugan
 * @date 2020/4/7
 */
public class NetUtil {

    public static void closeSilent(Closeable closeable) {
        if (closeable != null) {
            try {
                closeable.close();
            } catch (IOException e) {
                //do nothing
            }
        }
    }

    public static InetAddress localHost() throws UnknownHostException {
        return InetAddress.getLocalHost();
    }

}
